package gamesys.games.particlesystem.editor
{
	import gamesys.games.particlesystem.effects.IEffect;
	import gamesys.games.particlesystem.core.ParticleSystem;
	import flash.utils.Dictionary;
	/**
	 * @author robertthurston
	 */
	public class ParticleSystemEditorModel
	{
		private var _particleSystems : Dictionary;
		private var _effectIDS : Dictionary;
		
		public function ParticleSystemEditorModel()
		{
			_particleSystems = new Dictionary();
			_effectIDS = new Dictionary();
		}

		public function addParticleSystem(particleSystemID : String, particleSystem : ParticleSystem) : void
		{
			_particleSystems[particleSystemID] = particleSystem;
		}

		public function addEffect(particleSystemID : String, effect : IEffect) : void
		{
			var particleSystem : ParticleSystem = _particleSystems[particleSystemID];

			var effectID : uint = particleSystem.addEffect(effect);
			
			_effectIDS
		}

		public function removeParticleSystem(ID : String) : void
		{
			var particleSystem : ParticleSystem = _particleSystems[ID];
			
			particleSystem.stopEmitting();
			particleSystem.reset();
			particleSystem.removeAllEffects();
			particleSystem = null;
			
			delete _particleSystems[ID];
		}
	}
}
